package com.tong.embeddedvr.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * TODO
 *
 * @author gcl
 * @version 1.0
 * @Description 由于在springboot项目中默认使用MultipartFile接收,这里我们要使之用CommonMultipartFile接收
 * @date 2021/2/26 10:04
 */
@Configuration
public class MultipartConfig {
    @Bean(name = "multipartResolver")
    public CommonsMultipartResolver getCommonsMultipartResolver() {
        CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
        multipartResolver.setMaxUploadSize(20971520);
        multipartResolver.setMaxInMemorySize(1048576);
        return multipartResolver;
    }
}
